package com.evil.common.application.dto.permission.control;

import com.evil.common.application.enums.form.ControlPermissionSourceTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.Collection;

/**
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ControlPermissionsReqDTO {

    /**
     * 源类型
     */
    @NotNull(message = "源类型不能为空")
    private Integer sourceType;

    /**
     * 源ids
     */
    private Collection<Long> sourceIds;

    public ControlPermissionsReqDTO(@NotNull(message = "sourceType not null") ControlPermissionSourceTypeEnum controlPermissionSourceTypeEnum, Collection<Long> sourceIds) {
        this.sourceType = controlPermissionSourceTypeEnum.getId();
        this.sourceIds = sourceIds;
    }
}
